<template>
  <div class="home">
     <h1>{{title}}---总人数：{{supNum+oppNum}}</h1>
	 <VoteMain :supNum="supNum" :oppNum="oppNum"></VoteMain>
	 <VoteFooter @myEvent="get"></VoteFooter>
  </div>
</template>

<script>
import VoteMain from "@/components/Votemain.vue";
import VoteFooter from "@/components/Votefooter.vue";

export default {
  name: 'Home',
  data(){
	  return{
		title:"你喜欢大海吗？" ,
		supNum:5,
		oppNum:5
	  }
  },
  components:{
	  VoteMain,
	  VoteFooter
  },
  methods:{
	  get(val){
		 if(val=="sup"){
			 this.supNum++;
		 }else{
			 this.oppNum++;
		 }
	  }
  }
}
</script>
